import { Component, OnInit } from '@angular/core';
import {Router} from "@angular/router";

@Component({
  selector: 'app-navbar',
  templateUrl: './navbar.component.html',
  styleUrls: ['./navbar.component.css']
})
export class NavbarComponent implements OnInit {

  constructor(private router: Router) {

  }

  ngOnInit() {
  }

  /**
   * 通过js代码 实现路由功能
   */
  toProductDetail() {
    this.router.navigate(['/product', 50]);
  }

}
